5410 FOR A=1 TO SRS:LOCATE 0,18:PRINT "移動中"+NAMAE$(R%(A))+" "
5420 IF PAT%(A)>=3 AND PAT%(A)<=9 THEN GOSUB *IDO:GOSUB *HYOUZI_IDO
5430 IF PAT%(A)>=20 AND PAT%(A)<=23 THEN GOSUB *IKUSA
5440 IF PAT%(A)=1 THEN GOSUB *ZIN
5450 TX=X1%(A)+640:TY=Y1%(A):Q=PAT%(A)+BUGU%(A)
5460 IF X1-ZX>TX OR X1+ZX-2<TX THEN 5650
5470 IF Y1-ZY>TY OR Y1+ZY-2<TY THEN 5650
5480 IF PAT%(A)=0 AND BUGU%(A)=0 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A1%,MATTE,1,1,%15
5490 IF PAT%(A)=0 AND BUGU%(A)=1 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A2%,MATTE,1,1,%15
5500 IF PAT%(A)=1 AND BUGU%(A)=0 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A1%,MATTE,1,1,%15
5510 IF PAT%(A)=1 AND BUGU%(A)=1 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A2%,MATTE,1,1,%15
5520 IF Q=3 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+651,(ZY-(Y1-TY))*ZK+151),A3%,MATTE,1,1,%15
5530 IF Q=4 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+651,(ZY-(Y1-TY))*ZK+151),A4%,MATTE,1,1,%15
5540 IF Q=5 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A5%,MATTE,1,1,%15
5550 IF Q=6 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A6%,MATTE,1,1,%15
5560 IF Q=7 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A7%,MATTE,1,1,%15
5570 IF Q=8 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A8%,MATTE,1,1,%15
5580 IF Q=9 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A9%,MATTE,1,1,%15
5590 IF Q=10 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A10%,MATTE,1,1,%15
5600 IF Q=13 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+4,(ZY-(Y1-TY))*ZK+140+11),A1%,MATTE,1,1,%15
5610 IF Q=14 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+4,(ZY-(Y1-TY))*ZK+140+11),A2%,MATTE,1,1,%15
5620 IF PAT%(A)=20 OR PAT%(A)=21 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+646,(ZY-(Y1-TY))*ZK+153),A15%,MATTE,1,1,%15:GOTO 5640
5630 IF PAT%(A)=22 OR PAT%(A)=23 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+6,(ZY-(Y1-TY))*ZK+140+13),A16%,MATTE,1,1,%15:GOTO 5640
5640 ITI%((ZX-X1+TX)*ZK\12,(ZY-Y1+TY)*ZK\12)=A
5650 NEXT
5660 DIM W%(40000):GET@A (640,140)-(640+359,439),W%:PUT@A (0,0)-(359,299),W%
5960 IF KAKUDO_XY<=0 AND KAKUDO_Y<0 THEN PAT%(SYUTU)=7:Y1%(SYUTU)=Y1%(SYUTU)+1
5970 IF KAKUDO_XY>=0 AND KAKUDO_X>0 THEN PAT%(SYUTU)=9:X1%(SYUTU)=X1%(SYUTU)-1
5980 IF KAKUDO_XY>=0 AND KAKUDO_X<0 THEN PAT%(SYUTU)=5:X1%(SYUTU)=X1%(SYUTU)+1
5990 IF KAKUDO_XY<=0 AND KAKUDO_Y>0 THEN PAT%(SYUTU)=3:Y1%(SYUTU)=Y1%(SYUTU)-1
6000 RETURN
6010 *TEKI_TYOUSA
6020 FOR S=1 TO SRS
6030 TEKI%(S)=0
6040 IF A=S OR BUGU%(A)=BUGU%(S) THEN 6060 ELSE KYO=FIX(SQR((X1%(A)-X1%(S))^2+(Y1%(A)-Y1%(S))^2))-HE%(A)\2000:KEIKAI=KYO-BSN%(R)*7\(RD+1):TEKI_A=TEKI_A+1
6050 IF KEIKAI=<0 THEN GOSUB *GUNZISA
6060 NEXT
6070 RETURN
6080 *TEKI_TYOUSAIDO
6090 FOR S=1 TO SRS
6100 IF A=S OR BUGU%(A)=BUGU%(S) THEN 6060 ELSE KYO=FIX(SQR((X1%(A)-X1%(S))^2+(Y1%(A)-Y1%(S))^2))+HE%(A)\4000:KEIKAI=KYO-BSN%(R)*7\(RD+1)
12850 IF PAT%(A)=0 AND BUGU%(A)=0 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A1%,MATTE,1,1,%15
12860 IF PAT%(A)=0 AND BUGU%(A)=1 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A2%,MATTE,1,1,%15
12870 IF PAT%(A)=1 AND BUGU%(A)=0 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A1%,MATTE,1,1,%15
12880 IF PAT%(A)=1 AND BUGU%(A)=1 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+644,(ZY-(Y1-TY))*ZK+151),A2%,MATTE,1,1,%15
12890 IF Q=3 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+651,(ZY-(Y1-TY))*ZK+151),A3%,MATTE,1,1,%15
12900 IF Q=4 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+651,(ZY-(Y1-TY))*ZK+151),A4%,MATTE,1,1,%15
12910 IF Q=5 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A5%,MATTE,1,1,%15
12920 IF Q=6 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A6%,MATTE,1,1,%15
12930 IF Q=7 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A7%,MATTE,1,1,%15
12940 IF Q=8 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A8%,MATTE,1,1,%15
12950 IF Q=9 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A9%,MATTE,1,1,%15
12960 IF Q=10 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+11,(ZY-(Y1-TY))*ZK+140+11),A10%,MATTE,1,1,%15
12970 IF Q=13 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+4,(ZY-(Y1-TY))*ZK+140+11),A1%,MATTE,1,1,%15
12980 IF Q=14 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+4,(ZY-(Y1-TY))*ZK+140+11),A2%,MATTE,1,1,%15
12990 IF PAT%(A)=20 OR PAT%(A)=21 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+646,(ZY-(Y1-TY))*ZK+153),A15%,MATTE,1,1,%15:GOTO 13010
13000 IF PAT%(A)=22 OR PAT%(A)=23 THEN PUT@A ((ZX-(X1-TX))*ZK+640,(ZY-(Y1-TY))*ZK+140)-((ZX-(X1-TX))*ZK+640+6,(ZY-(Y1-TY))*ZK+140+13),A16%,MATTE,1,1,%15:GOTO 13010
13010 ITI%((ZX-X1+TX)*ZK\12,(ZY-Y1+TY)*ZK\12)=A
13020 NEXT
13030 DIM W%(40000):GET@A (640,140)-(640+359,439),W%:PUT@A (0,0)-(359,299),W%
13040 ERASE W%
13050 RETURN
13060 *SEIRETU:B=0:BTN=0
13070 FOR I=0 TO 579
13080 IF SYO%(I)=R%(BUKA) THEN B=B+1:BUKA%(B)=I ELSE 13160
13090 IF B>0 AND B<=6 THEN LOCATE (B-1)*14,18:PRINT NAMAE$(I)
13100 IF B>6 AND B<=12 THEN LOCATE (B-7)*14,19:PRINT NAMAE$(I)
13110 IF B>12 AND B<=18 THEN LOCATE (B-13)*14,20:PRINT NAMAE$(I)
13120 IF B>18 AND B<=24 THEN LOCATE (B-19)*14,21:PRINT NAMAE$(I)
13130 IF B>24 AND B<=30 THEN LOCATE (B-25)*14,22:PRINT NAMAE$(I)
13140 IF B>30 AND B<=36 THEN LOCATE (B-31)*14,23:PRINT NAMAE$(I)
13150 IF B>36 AND B<=42 THEN LOCATE (B-37)*14,24:PRINT NAMAE$(I)
13160 NEXT:IF B>43 THEN B=42
13170 WHILE BTN=0
13180 WHILE MOUSE(2,0)=0:WEND
13190 X1=MOUSE(0)\112:Y1=MOUSE(1)\19.2!-18
13200 R=6*Y1+X1+1
13210 IF R>B THEN BTN=0 ELSE BTN=1
13220 WEND
13230 P=BUKA%(R)
13240 RETURN
13250 *ZEHI:WHILE MOUSE(2,0)=-1:WEND
13260 LOCATE 0,19:PRINT " 是 非 "
13270 WHILE MOUSE(2,0)=0:WEND
13280 X5=MOUSE(0):Y5=MOUSE(1)
13290 IF Y5>374 OR Y5<354 THEN 13270
13300 IF X5<=40 THEN ZEHI=1
13310 IF X5>40 AND X5<=80 THEN ZEHI=0
13320 RETURN
13330 *COM_KASSEN
13340 IF O=PLAYR THEN TEKI=A ELSE TEKI=O
13350 FOR I=1 TO 5:BEEP 1:WAIT 20:BEEP 0:WAIT 20:NEXT